package PAPFastSwap;

import com.aliasi.spell.JaroWinklerDistance;

public class ClassAnchor {
	private JaroWinklerDistance winkler = new JaroWinklerDistance();
	private PAPClass classBi, classBj;
	private int indexOfBlock;
	
	public ClassAnchor(PAPClass classBi, PAPClass classBj, int indexOfBlock) {
		super();
		this.classBi = classBi;
		this.classBj = classBj;
		this.indexOfBlock = indexOfBlock;
	}
	
	public ClassAnchor(PAPClass classBi, PAPClass classBj) {
		super();
		this.classBi = classBi;
		this.classBj = classBj;
	}

	public int getIndexOfBlock() {
		return indexOfBlock;
	}

	public void setIndexOfBlock(int indexOfBlock) {
		this.indexOfBlock = indexOfBlock;
	}

	public PAPClass getClassBi() {
		return classBi;
	}

	public void setClassBi(PAPClass classBi) {
		this.classBi = classBi;
	}

	public PAPClass getClassBj() {
		return classBj;
	}

	public void setClassBj(PAPClass classBj) {
		this.classBj = classBj;
	}
	
	@Override
	public String toString() {
		if (getClassBi() != null && getClassBj() != null) {
			return getClassBi().getOwlClass().getIRI().getFragment() + " - " + getClassBj().getOwlClass().getIRI().getFragment();
		} else {
			return "Null value.";
		}
	}
	
	public double getProximity() {
		return winkler.proximity(classBi.getLabel(), classBj.getLabel());
	}


}
